package no.sachmuld.methodcombination.demo;

import no.sachmuld.methodcombination.api.CrosscuttingBehaviour;
import no.sachmuld.methodcombination.api.MethodInvocation;

import java.util.List;

/**
 *
 */
public abstract class RepositoryBehaviour <T extends Entity> extends CrosscuttingBehaviour {

    public T insert(T entity, MethodInvocation<T> invocation) {
        return invocation.proceed();
    }

    public T update(T entity, MethodInvocation<T> invocation) {
        return invocation.proceed();
    }

    public T select(Long id, MethodInvocation<T> invocation) {
        return invocation.proceed();
    }

    public List<T> selectAll(MethodInvocation<List<T>> invocation) {
        return invocation.proceed();
    }

    public void delete(Long id, MethodInvocation<Void> invocation) {
        invocation.proceed();
    }

    public long count(MethodInvocation<Long> invocation) {
        return invocation.proceed();
    }

}
